package com.twopai.appbase;

import android.app.Application;

import com.alibaba.android.arouter.launcher.ARouter;
import com.twopai.appbase.routerpath.ARouterManager;

/**
 * author : twopai
 * description 公共模块基类Application
 */
public abstract class BaseApplication extends Application {
    public static BaseApplication instance;

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        init();
    }

    private void init() {
        //组件化ARouter初始化
        if (isDebug()) {
//            ARouter.openDebug();
//            ARouter.openLog();
            ARouterManager.openDebug();
            ARouterManager.openLog();
        }
//        ARouter.init(this);
        ARouterManager.init(this);
    }
    public static Application getInstance() {
        return instance;
    }
    public abstract boolean isDebug();
}
